$(document).ready(function () {

    $("#daifukuan").click(function () {
        alert(1)
        var state = 0;
        var resData;
        $.getJSON("http://ivr3ur.natappfree.cc/QueryOrdertoState", {
            "userid": 1,
            "state": state
        }, function (data) {
            resData = data;
            console.log("返回结果data：" + data);
            var str = "";
            $.each(resData, function (key, values) {
                console.log(key);
                $(values).each(function () {
                    console.log("list\t" + this.shoppingTestList);
                    var li = "";
                    var dataMessage = this.shoppingTestList;
                    console.log(resData)
                    console.log(values)
                    $(dataMessage).each(function (i) {
                        console.log(dataMessage)
                        console.log(dataMessage[i])
                        li += "<li class=\"ellipsis\">\n" +
                            "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                            "        class=\"fl\"\n" +
                            "        src=\"" + dataMessage[i].path + "\"></a>\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">" + dataMessage[i].name + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">数量" + dataMessage[i].number + "</h3></a>\n" +
                            "\n" +
                            "<div class=\"fl order-pro-title\" >\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" style='display: none' target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">状态" + dataMessage[i].state + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "        <button class=\"buy-btn\"\n" +
                            "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                            "        </button>\n" +
                            "            <button class=\"buy-btn\"\n" +
                            "                          onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                            "             </button>" +
                            "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                            "            <div class=\"addtocart-arrow\">\n" +
                            "                <i></i>\n" +
                            "            </div>\n" +
                            "            <div class=\"addtocart-text\">\n" +
                            "                <i class=\"addtocart-icon\"></i>\n" +
                            "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                            "            </div>\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "</div>\n" +
                            "                                                </li>\n";
                        +
                            "+";
                    });

                    str += "<div class=\"order-item\">\n" +
                        "                                <!-- 订单头部信息 start -->\n" +
                        "                                <div class=\"order-header clearfix\">\n" +
                        "                                    <div class=\"order-time order-head-common fl\">" + values.createordertime + "</div>\n" +
                        "                                    <div class=\"order-no-con fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                        "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                           class=\"order-no-link fl\">" + values.id + "</a>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-reveicer fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                        "                                        <div class=\"order-rervicer-detail fl\">\n" +
                        "                                            <span class=\"order-rervicer-name ellipsis fl\">" + values.receiver + "</span>\n" +
                        "                                            <div class=\"order-reveicer-box\">\n" +
                        "                                                <i class=\"reveicer-box-arrow\">\n" +
                        "<b></b>\n" +
                        "                                                </i>\n" +
                        "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + values.name + "</p>\n" +
                        "                                                <p class=\"reveicer-box-text\">" + values.adress + "</p>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-money fr ellipsis\">\n" +
                        "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                        "                                        <b class=\"order-money-sym\">¥</b>\n" +
                        "                                        <b class=\"order-money-num\">" + values.pricetotal + "</b>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-shop-server fr\">\n" +
                        "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                        "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                        "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                        "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                        "                                           class=\"order-server server-disable\"\n" +
                        "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                        "\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 订单头部信息 end -->\n" +
                        "                                <!-- 商品列表和按钮 start -->\n" +
                        "                                <div class=\"order-content\">\n" +
                        "                                    <div class=\"order-list ellipsis\">\n" +
                        "                                        <div class=\"order-item-pro fl\">\n" +
                        "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                        "                                            <ul class=\"order-pro-list\">\n" + li +
                        "                                            </ul>\n" +
                        "                                            <!-- 预售定金尾款状态 start -->\n" +
                        "                                            <!-- 预售定金尾款状态 end -->\n" +
                        "                                        </div>\n" +
                        "                                        <div class=\"order-btns fl\">\n" +
                        "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                        "\n" +
                        "\n" +
                        "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 商品列表和按钮 end -->\n" +
                        "                            </div>";
                    $("#order").html(str);
                });

            });

        });

        console.log(resData);
    })
    $("#daishouhuo").click(function () {
        var state = 1;
        var resData;
        $.getJSON("http://ivr3ur.natappfree.cc/QueryOrdertoState", {
            "userid": 1,
            "state": state
        }, function (data) {
            resData = data;
            console.log("返回结果data：" + data);
            var str = "";
            $.each(resData, function (key, values) {
                alert(data);
                console.log(key);
                $(values).each(function () {
                    console.log("list\t" + this.shoppingTestList);
                    var li = "";
                    var dataMessage = this.shoppingTestList;
                    console.log(resData)
                    console.log(values)
                    $(dataMessage).each(function (i) {
                        console.log(dataMessage)
                        console.log(dataMessage[i])
                        li += "<li class=\"ellipsis\">\n" +
                            "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                            "        class=\"fl\"\n" +
                            "        src=\"" + dataMessage[i].path + "\"></a>\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">" + dataMessage[i].name + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">数量" + dataMessage[i].number + "</h3></a>\n" +
                            "\n" +
                            "<div class=\"fl order-pro-title\" >\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" style='display: none' target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">状态" + dataMessage[i].state + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "        <button class=\"buy-btn\"\n" +
                            "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                            "        </button>\n" +
                            "           <button class=\"buy-btn\"\n" +
                            "            onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                            "            </button>" +
                            "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                            "            <div class=\"addtocart-arrow\">\n" +
                            "                <i></i>\n" +
                            "            </div>\n" +
                            "            <div class=\"addtocart-text\">\n" +
                            "                <i class=\"addtocart-icon\"></i>\n" +
                            "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                            "            </div>\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "</div>\n" +
                            "                                                </li>\n";
                        +
                            "+";
                    });

                    str += "<div class=\"order-item\">\n" +
                        "                                <!-- 订单头部信息 start -->\n" +
                        "                                <div class=\"order-header clearfix\">\n" +
                        "                                    <div class=\"order-time order-head-common fl\">" + values.createordertime + "</div>\n" +
                        "                                    <div class=\"order-no-con fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                        "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                           class=\"order-no-link fl\">" + values.id + "</a>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-reveicer fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                        "                                        <div class=\"order-rervicer-detail fl\">\n" +
                        "                                            <span class=\"order-rervicer-name ellipsis fl\">" + values.receiver + "</span>\n" +
                        "                                            <div class=\"order-reveicer-box\">\n" +
                        "                                                <i class=\"reveicer-box-arrow\">\n" +
                        "<b></b>\n" +
                        "                                                </i>\n" +
                        "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + values.name + "</p>\n" +
                        "                                                <p class=\"reveicer-box-text\">" + values.adress + "</p>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-money fr ellipsis\">\n" +
                        "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                        "                                        <b class=\"order-money-sym\">¥</b>\n" +
                        "                                        <b class=\"order-money-num\">" + values.pricetotal + "</b>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-shop-server fr\">\n" +
                        "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                        "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                        "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                        "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                        "                                           class=\"order-server server-disable\"\n" +
                        "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                        "\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 订单头部信息 end -->\n" +
                        "                                <!-- 商品列表和按钮 start -->\n" +
                        "                                <div class=\"order-content\">\n" +
                        "                                    <div class=\"order-list ellipsis\">\n" +
                        "                                        <div class=\"order-item-pro fl\">\n" +
                        "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                        "                                            <ul class=\"order-pro-list\">\n" + li +
                        "                                            </ul>\n" +
                        "                                            <!-- 预售定金尾款状态 start -->\n" +
                        "                                            <!-- 预售定金尾款状态 end -->\n" +
                        "                                        </div>\n" +
                        "                                        <div class=\"order-btns fl\">\n" +
                        "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                        "\n" +
                        "\n" +
                        "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 商品列表和按钮 end -->\n" +
                        "                            </div>";
                    if (data!=undefined) {
                        alert(000)
                        $("#order").html(str);
                    }else{
                        alert(111)
                        $("#order").html("");
                    }
                });

            });

        });
        console.log(resData);
    })
    $("#yiwancheng").click(function () {
        var state = 2;
        var resData;
        $.getJSON("http://ivr3ur.natappfree.cc/QueryOrdertoState", {
            "userid": 1,
            "state": state
        }, function (data) {
            resData = data;
            console.log("返回结果data：" + data);
            var str = "";
            $.each(resData, function (key, values) {
                console.log(key);
                $(values).each(function () {
                    console.log("list\t" + this.shoppingTestList);
                    var li = "";
                    var dataMessage = this.shoppingTestList;
                    console.log(resData)
                    console.log(values)
                    $(dataMessage).each(function (i) {
                        console.log(dataMessage)
                        console.log(dataMessage[i])
                        li += "<li class=\"ellipsis\">\n" +
                            "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                            "        class=\"fl\"\n" +
                            "        src=\"" + dataMessage[i].path + "\"></a>\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">" + dataMessage[i].name + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\"  target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">数量" + dataMessage[i].number + "</h3></a>\n" +
                            "\n" +
                            "<div class=\"fl order-pro-title\" >\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" style='display: none' target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">状态" + dataMessage[i].state + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "        <button class=\"buy-btn\"\n" +
                            "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                            "        </button>\n" +
                            "          <button class=\"buy-btn\"\n" +
                            "           onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                            "          </button>" +
                            "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                            "            <div class=\"addtocart-arrow\">\n" +
                            "                <i></i>\n" +
                            "            </div>\n" +
                            "            <div class=\"addtocart-text\">\n" +
                            "                <i class=\"addtocart-icon\"></i>\n" +
                            "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                            "            </div>\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "</div>\n" +
                            "                                                </li>\n";
                        +
                            "+";
                    });

                    str += "<div class=\"order-item\">\n" +
                        "                                <!-- 订单头部信息 start -->\n" +
                        "                                <div class=\"order-header clearfix\">\n" +
                        "                                    <div class=\"order-time order-head-common fl\">" + values.createordertime + "</div>\n" +
                        "                                    <div class=\"order-no-con fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                        "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                           class=\"order-no-link fl\">" + values.id + "</a>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-reveicer fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                        "                                        <div class=\"order-rervicer-detail fl\">\n" +
                        "                                            <span class=\"order-rervicer-name ellipsis fl\">" + values.receiver + "</span>\n" +
                        "                                            <div class=\"order-reveicer-box\">\n" +
                        "                                                <i class=\"reveicer-box-arrow\">\n" +
                        "<b></b>\n" +
                        "                                                </i>\n" +
                        "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + values.name + "</p>\n" +
                        "                                                <p class=\"reveicer-box-text\">" + values.adress + "</p>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-money fr ellipsis\">\n" +
                        "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                        "                                        <b class=\"order-money-sym\">¥</b>\n" +
                        "                                        <b class=\"order-money-num\">" + values.pricetotal + "</b>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-shop-server fr\">\n" +
                        "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                        "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                        "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                        "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                        "                                           class=\"order-server server-disable\"\n" +
                        "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                        "\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 订单头部信息 end -->\n" +
                        "                                <!-- 商品列表和按钮 start -->\n" +
                        "                                <div class=\"order-content\">\n" +
                        "                                    <div class=\"order-list ellipsis\">\n" +
                        "                                        <div class=\"order-item-pro fl\">\n" +
                        "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                        "                                            <ul class=\"order-pro-list\">\n" + li +
                        "                                            </ul>\n" +
                        "                                            <!-- 预售定金尾款状态 start -->\n" +
                        "                                            <!-- 预售定金尾款状态 end -->\n" +
                        "                                        </div>\n" +
                        "                                        <div class=\"order-btns fl\">\n" +
                        "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                        "\n" +
                        "\n" +
                        "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 商品列表和按钮 end -->\n" +
                        "                            </div>";
                    $("#order").html(str);
                });

            });

        });

        console.log(resData);
    })
    $("#yiquxiao").click(function () {
        var state = 3;
        var resData;
        $.getJSON("http://ivr3ur.natappfree.cc/QueryOrdertoState", {
            "userid": 1,
            "state": state
        }, function (data) {
            resData = data;
            console.log("返回结果data：" + data);
            var str = "";
            $.each(resData, function (key, values) {
                console.log(key);
                $(values).each(function () {
                    console.log("list\t" + this.shoppingTestList);
                    var li = "";
                    var dataMessage = this.shoppingTestList;
                    console.log(resData)
                    console.log(values)
                    $(dataMessage).each(function (i) {
                        console.log(dataMessage)
                        console.log(dataMessage[i])
                        li += "<li class=\"ellipsis\">\n" +
                            "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                            "        class=\"fl\"\n" +
                            "        src=\"" + dataMessage[i].path + "\"></a>\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">" + dataMessage[i].name + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">数量" + dataMessage[i].number + "</h3></a>\n" +
                            "\n" +
                            "<div class=\"fl order-pro-title\" >\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" style='display: none' target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">状态" + dataMessage[i].state + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "        <button class=\"buy-btn\"\n" +
                            "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                            "        </button>\n" +
                            "            <button class=\"buy-btn\"\n" +
                            "                  onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                            "            </button>" +
                            "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                            "            <div class=\"addtocart-arrow\">\n" +
                            "                <i></i>\n" +
                            "            </div>\n" +
                            "            <div class=\"addtocart-text\">\n" +
                            "                <i class=\"addtocart-icon\"></i>\n" +
                            "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                            "            </div>\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "</div>\n" +
                            "                                                </li>\n";
                        +
                            "+";
                    });

                    str += "<div class=\"order-item\">\n" +
                        "                                <!-- 订单头部信息 start -->\n" +
                        "                                <div class=\"order-header clearfix\">\n" +
                        "                                    <div class=\"order-time order-head-common fl\">" + values.createordertime + "</div>\n" +
                        "                                    <div class=\"order-no-con fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                        "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                           class=\"order-no-link fl\">" + values.id + "</a>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-reveicer fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                        "                                        <div class=\"order-rervicer-detail fl\">\n" +
                        "                                            <span class=\"order-rervicer-name ellipsis fl\">" + values.receiver + "</span>\n" +
                        "                                            <div class=\"order-reveicer-box\">\n" +
                        "                                                <i class=\"reveicer-box-arrow\">\n" +
                        "<b></b>\n" +
                        "                                                </i>\n" +
                        "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + values.name + "</p>\n" +
                        "                                                <p class=\"reveicer-box-text\">" + values.adress + "</p>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-money fr ellipsis\">\n" +
                        "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                        "                                        <b class=\"order-money-sym\">¥</b>\n" +
                        "                                        <b class=\"order-money-num\">" + values.pricetotal + "</b>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-shop-server fr\">\n" +
                        "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                        "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                        "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                        "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                        "                                           class=\"order-server server-disable\"\n" +
                        "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                        "\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 订单头部信息 end -->\n" +
                        "                                <!-- 商品列表和按钮 start -->\n" +
                        "                                <div class=\"order-content\">\n" +
                        "                                    <div class=\"order-list ellipsis\">\n" +
                        "                                        <div class=\"order-item-pro fl\">\n" +
                        "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                        "                                            <ul class=\"order-pro-list\">\n" + li +
                        "                                            </ul>\n" +
                        "                                            <!-- 预售定金尾款状态 start -->\n" +
                        "                                            <!-- 预售定金尾款状态 end -->\n" +
                        "                                        </div>\n" +
                        "                                        <div class=\"order-btns fl\">\n" +
                        "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                        "\n" +
                        "\n" +
                        "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 商品列表和按钮 end -->\n" +
                        "                            </div>";
                    if (dataMessage!="") {
                        $("#order").html(str);
                    }else{
                        $("#order").html("");
                    }
                });

            });

        });

        console.log(resData);
    })
    $("#suoyou").click(function () {
        var resData;
        $.getJSON("http://ivr3ur.natappfree.cc/QueryAllOrder", {"userid": 1}, function (data) {
            resData = data;
            console.log("返回结果data：" + data);
            var str = "";
            $.each(resData, function (key, values) {
                console.log(key);
                $(values).each(function () {
                    console.log("list\t" + this.shoppingTestList);
                    var li = "";
                    var dataMessage = this.shoppingTestList;
                    console.log(resData)
                    console.log(values)
                    $(dataMessage).each(function (i) {
                        console.log(dataMessage)
                        console.log(dataMessage[i])
                        li += "<li class=\"ellipsis\">\n" +
                            "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                            "        class=\"fl\"\n" +
                            "        src=\"" + dataMessage[i].path + "\"></a>\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">" + dataMessage[i].name + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "<div class=\"fl order-pro-title\">\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">数量" + dataMessage[i].number + "</h3></a>\n" +
                            "\n" +
                            "<div class=\"fl order-pro-title\" >\n" +
                            "    <a href=\"//item.yhd.com/2594135.html\" style='display: none' target=\"_blank\"><h3\n" +
                            "            class=\"ellipsis\">状态" + dataMessage[i].state + "</h3></a>\n" +
                            "\n" +
                            "    <div class=\"buy-btn-con\">\n" +
                            "        <button class=\"buy-btn\"\n" +
                            "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                            "        </button>\n" +
                            "           <button class=\"buy-btn\"\n" +
                            "                   onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                            "           </button>" +
                            "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                            "            <div class=\"addtocart-arrow\">\n" +
                            "                <i></i>\n" +
                            "            </div>\n" +
                            "            <div class=\"addtocart-text\">\n" +
                            "                <i class=\"addtocart-icon\"></i>\n" +
                            "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                            "            </div>\n" +
                            "        </div>\n" +
                            "    </div>\n" +
                            "</div>\n" +
                            "                                                </li>\n";
                        +
                            "+";
                    });

                    str += "<div class=\"order-item\">\n" +
                        "                                <!-- 订单头部信息 start -->\n" +
                        "                                <div class=\"order-header clearfix\">\n" +
                        "                                    <div class=\"order-time order-head-common fl\">" + values.createordertime + "</div>\n" +
                        "                                    <div class=\"order-no-con fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                        "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                           class=\"order-no-link fl\">" + values.id + "</a>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-reveicer fl\">\n" +
                        "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                        "                                        <div class=\"order-rervicer-detail fl\">\n" +
                        "                                            <span class=\"order-rervicer-name ellipsis fl\">" + values.receiver + "</span>\n" +
                        "                                            <div class=\"order-reveicer-box\">\n" +
                        "                                                <i class=\"reveicer-box-arrow\">\n" +
                        "<b></b>\n" +
                        "                                                </i>\n" +
                        "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + values.name + "</p>\n" +
                        "                                                <p class=\"reveicer-box-text\">" + values.adress + "</p>\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-money fr ellipsis\">\n" +
                        "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                        "                                        <b class=\"order-money-sym\">¥</b>\n" +
                        "                                        <b class=\"order-money-num\">" + values.pricetotal + "</b>\n" +
                        "                                    </div>\n" +
                        "                                    <div class=\"order-shop-server fr\">\n" +
                        "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                        "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                        "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                        "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                        "                                           class=\"order-server server-disable\"\n" +
                        "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                        "\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 订单头部信息 end -->\n" +
                        "                                <!-- 商品列表和按钮 start -->\n" +
                        "                                <div class=\"order-content\">\n" +
                        "                                    <div class=\"order-list ellipsis\">\n" +
                        "                                        <div class=\"order-item-pro fl\">\n" +
                        "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                        "                                            <ul class=\"order-pro-list\">\n" + li +
                        "                                            </ul>\n" +
                        "                                            <!-- 预售定金尾款状态 start -->\n" +
                        "                                            <!-- 预售定金尾款状态 end -->\n" +
                        "                                        </div>\n" +
                        "                                        <div class=\"order-btns fl\">\n" +
                        "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                        "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                        "\n" +
                        "\n" +
                        "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                        "                                            </div>\n" +
                        "                                        </div>\n" +
                        "                                    </div>\n" +
                        "                                </div>\n" +
                        "                                <!-- 商品列表和按钮 end -->\n" +
                        "                            </div>";
                    $("#order").html(str);
                });

            });

        });

        console.log(resData);
    })
    // QueryllOrders();
    var resData;
    $.getJSON("http://ivr3ur.natappfree.cc/QueryAllOrder", {"userid": 1}, function (data) {
        resData = data;
        console.log("返回结果data：" + data);
        var str = "";
        $.each(resData, function (key, values) {
            console.log(key);
            $(values).each(function () {
                console.log("list\t" + this.shoppingTestList);
                var li = "";
                var dataMessage = this.shoppingTestList;
                console.log(resData)
                console.log(values)
                $(dataMessage).each(function (i) {
                    console.log(dataMessage)
                    console.log(dataMessage[i])
                    li += "<li class=\"ellipsis\">\n" +
                        "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                        "        class=\"fl\"\n" +
                        "        src=\"" + dataMessage[i].path + "\"></a>\n" +
                        "<div class=\"fl order-pro-title\">\n" +
                        "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                        "            class=\"ellipsis\">" + dataMessage[i].name + "</h3></a>\n" +
                        "\n" +
                        "    <div class=\"buy-btn-con\">\n" +
                        "<div class=\"fl order-pro-title\">\n" +
                        "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                        "            class=\"ellipsis\">数量" + dataMessage[i].number + "</h3></a>\n" +
                        "\n" +
                        "<div class=\"fl order-pro-title\" >\n" +
                        "    <a href=\"//item.yhd.com/2594135.html\" style='display: none' target=\"_blank\"><h3\n" +
                        "            class=\"ellipsis\">状态" + dataMessage[i].state + "</h3></a>\n" +
                        "\n" +
                        "    <div class=\"buy-btn-con\">\n" +
                        "        <button class=\"buy-btn\"\n" +
                        "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                        "        </button>\n" +
                        "           <button class=\"buy-btn\"\n" +
                        "                     onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                        "           </button>" +
                        "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                        "            <div class=\"addtocart-arrow\">\n" +
                        "                <i></i>\n" +
                        "            </div>\n" +
                        "            <div class=\"addtocart-text\">\n" +
                        "                <i class=\"addtocart-icon\"></i>\n" +
                        "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                        "            </div>\n" +
                        "        </div>\n" +
                        "    </div>\n" +
                        "</div>\n" +
                        "                                                </li>\n";
                    +
                        "+";
                });

                str += "<div class=\"order-item\">\n" +
                    "                                <!-- 订单头部信息 start -->\n" +
                    "                                <div class=\"order-header clearfix\">\n" +
                    "                                    <div class=\"order-time order-head-common fl\">" + values.createordertime + "</div>\n" +
                    "                                    <div class=\"order-no-con fl\">\n" +
                    "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                    "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                    "                                           class=\"order-no-link fl\">" + values.id + "</a>\n" +
                    "                                    </div>\n" +
                    "                                    <div class=\"order-reveicer fl\">\n" +
                    "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                    "                                        <div class=\"order-rervicer-detail fl\">\n" +
                    "                                            <span class=\"order-rervicer-name ellipsis fl\">" + values.receiver + "</span>\n" +
                    "                                            <div class=\"order-reveicer-box\">\n" +
                    "                                                <i class=\"reveicer-box-arrow\">\n" +
                    "<b></b>\n" +
                    "                                                </i>\n" +
                    "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + values.name + "</p>\n" +
                    "                                                <p class=\"reveicer-box-text\">" + values.adress + "</p>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>\n" +
                    "                                    <div class=\"order-money fr ellipsis\">\n" +
                    "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                    "                                        <b class=\"order-money-sym\">¥</b>\n" +
                    "                                        <b class=\"order-money-num\">" + values.pricetotal + "</b>\n" +
                    "                                    </div>\n" +
                    "                                    <div class=\"order-shop-server fr\">\n" +
                    "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                    "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                    "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                    "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                    "                                           class=\"order-server server-disable\"\n" +
                    "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                    "\n" +
                    "                                    </div>\n" +
                    "                                </div>\n" +
                    "                                <!-- 订单头部信息 end -->\n" +
                    "                                <!-- 商品列表和按钮 start -->\n" +
                    "                                <div class=\"order-content\">\n" +
                    "                                    <div class=\"order-list ellipsis\">\n" +
                    "                                        <div class=\"order-item-pro fl\">\n" +
                    "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                    "                                            <ul class=\"order-pro-list\">\n" + li +
                    "                                            </ul>\n" +
                    "                                            <!-- 预售定金尾款状态 start -->\n" +
                    "                                            <!-- 预售定金尾款状态 end -->\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"order-btns fl\">\n" +
                    "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                    "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                    "\n" +
                    "\n" +
                    "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>\n" +
                    "                                </div>\n" +
                    "                                <!-- 商品列表和按钮 end -->\n" +
                    "                            </div>";
                $("#order").html(str);
            });

        });

    });

    console.log(resData);

});

function QueryllOrders() {
    $.getJSON("http://xi9jsy.natappfree.cc/QueryAllOrder", {"userid": 1}, function (data) {


        var li = "";


        var str = "";
        alert(data.length + "\t长度");
        $(data).each(map, function (i) {

            li += "                                <li class=\"ellipsis\">\n" +
                "<a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><img\n" +
                "        class=\"fl\"\n" +
                "        src=\"" + data[i].shoppingTestList.path + "\"></a>\n" +
                "<div class=\"fl order-pro-title\">\n" +
                "    <a href=\"//item.yhd.com/2594135.html\" target=\"_blank\"><h3\n" +
                "            class=\"ellipsis\">" + data[i].shoppingTestList.name + "</h3></a>\n" +
                "\n" +
                "    <div class=\"buy-btn-con\">\n" +
                "        <button class=\"buy-btn\"\n" +
                "                onclick=\"addItemsBySku('2594135',this)\">再次购买\n" +
                "        </button>\n" +
                "           <button class=\"buy-btn\"\n" +
                "                           onclick=\"addComment('"+dataMessage[i].state+"','"+dataMessage[i].storeid+"','"+dataMessage[i].commodityid+"')\">发表评论\n" +
                "           </button>" +
                "        <div class=\"addotcart-con\" style=\"display: none;\">\n" +
                "            <div class=\"addtocart-arrow\">\n" +
                "                <i></i>\n" +
                "            </div>\n" +
                "            <div class=\"addtocart-text\">\n" +
                "                <i class=\"addtocart-icon\"></i>\n" +
                "                <span class=\"addtocart-text-tip\">系统繁忙请稍后</span>\n" +
                "            </div>\n" +
                "        </div>\n" +
                "    </div>\n" +
                "</div>\n" +
                "                                                </li>\n";
            +
                "+";

            str += "<div class=\"order-item\">\n" +
                "                                <!-- 订单头部信息 start -->\n" +
                "                                <div class=\"order-header clearfix\">\n" +
                "                                    <div class=\"order-time order-head-common fl\">\n" +
                "                                        2019-05-25\n" +
                "                                    </div>\n" +
                "                                    <div class=\"order-no-con fl\">\n" +
                "                                        <b class=\"order-head-common fl\">订单号：</b>\n" +
                "                                        <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                "                                           class=\"order-no-link fl\">" + data[i].id + "</a>\n" +
                "                                    </div>\n" +
                "                                    <div class=\"order-reveicer fl\">\n" +
                "                                        <b class=\"order-head-common fl\">收货人：</b>\n" +
                "                                        <div class=\"order-rervicer-detail fl\">\n" +
                "                                            <span class=\"order-rervicer-name ellipsis fl\">" + data[i].receiver + "</span>\n" +
                "                                            <div class=\"order-reveicer-box\">\n" +
                "                                                <i class=\"reveicer-box-arrow\">\n" +
                "<b></b>\n" +
                "                                                </i>\n" +
                "                                                <p class=\"reveicer-box-text reveicer-text-name\">" + data[i].name + "</p>\n" +
                "                                                <p class=\"reveicer-box-text\">" + data[i].adress + "</p>\n" +
                "                                            </div>\n" +
                "                                        </div>\n" +
                "                                    </div>\n" +
                "                                    <div class=\"order-money fr ellipsis\">\n" +
                "                                        <b class=\"order-head-common\">总金额：</b>\n" +
                "                                        <b class=\"order-money-sym\">¥</b>\n" +
                "                                        <b class=\"order-money-num\">" + data[i].pricetotal + "</b>\n" +
                "                                    </div>\n" +
                "                                    <div class=\"order-shop-server fr\">\n" +
                "                                        <a href=\"javascript:void(0)\" class=\"order-shopname ellipsis fl\">格调同城</a>\n" +
                "                                        <!-- 默认客服在线状态， server-disable为不在线状态order-server-->\n" +
                "                                        <input type=\"hidden\" class=\"vanderCode\" value=\"4\" order=\"95922955760\">\n" +
                "                                        <a id=\"chat_show_95922955760\" href=\"javascript:void(0);\"\n" +
                "                                           class=\"order-server server-disable\"\n" +
                "                                           onclick=\"checkChat('95922955760','4')\"></a>\n" +
                "\n" +
                "                                    </div>\n" +
                "                                </div>\n" +
                "                                <!-- 订单头部信息 end -->\n" +
                "                                <!-- 商品列表和按钮 start -->\n" +
                "                                <div class=\"order-content\">\n" +
                "                                    <div class=\"order-list ellipsis\">\n" +
                "                                        <div class=\"order-item-pro fl\">\n" +
                "                                            <!-- <div class=\"order-item-header\"></div> -->\n" +
                "                                            <ul class=\"order-pro-list\">\n" + li +
                "                                            </ul>\n" +
                "                                            <!-- 预售定金尾款状态 start -->\n" +
                "                                            <!-- 预售定金尾款状态 end -->\n" +
                "                                        </div>\n" +
                "                                        <div class=\"order-btns fl\">\n" +
                "                                            <a href=\"/ordercenter/showDetail.do?orderCode=95922955760\" target=\"_blank\"\n" +
                "                                               class=\"common-btn btn-showdetail\">订单详情</a>\n" +
                "\n" +
                "\n" +
                "                                            <div class=\"btn-inv-eva\" style=\"text-align: center;\">\n" +
                "                                            </div>\n" +
                "                                        </div>\n" +
                "                                    </div>\n" +
                "                                </div>\n" +
                "                                <!-- 商品列表和按钮 end -->\n" +
                "                            </div>"
        });
        $("#order").html(str)
    })
}

function neo(id) { //这里id
    var oStar = document.getElementById(id);
    var aLi = oStar.getElementsByTagName("li");
    var oUl = oStar.getElementsByTagName("ul")[0];
    var oP = oStar.getElementsByTagName("p")[0];
    var i = iScore = iStar = 0;

    for (i = 1; i <= aLi.length; i++) {
        aLi[i - 1].index = i;
        //点击后进行评分处理
        aLi[i - 1].onclick = function () {
            fnPoint(this.index);
            //计算浮动层位置
            oP.style.left = oUl.offsetLeft + this.index * this.offsetWidth - 104 + "px";
            //匹配浮动层文字内容
            oP.innerHTML = "<b id='praise'>" + this.index + "</b> 分";
        }
    }

    //评分处理
    function fnPoint(iArg) {
        //分数赋值
        iScore = iArg || iStar;
        for (i = 0; i < aLi.length; i++) aLi[i].className = i < iScore ? "on" : "";
    }

};

function saveComment() {
    var orderState = 3;
    var date = new Date();
    var year = date.getFullYear(); //获取年
    var month = date.getMonth() + 1;//获取月
    var day = date.getDate(); //获取当日
    var time = year + "-" + month + "-" + day; //组合时间
    // alert("当前日期："+time);
    var storeId = $("#stId").val();
    var commodityid = $("#comId").val();
    if (orderState == 3) {
        var _data = {
            "storeid": storeId,
            "userid": 1,
            "commodityid": storeId,
            "praise": $("#praise").html(),
            "content": $("#content").val(),
            "createtime": time,
        }
        axios.post("http://ivr3ur.natappfree.cc/insertComments", _data)
            .then(function (response) {
                if (response.data > 0) {
                    alert("发表成功！")
                }
            })
    } else {
        alert("亲，您的商品还没有到货，请签收后再评论")
    }
}

function addComment(state, storeid, commodityid) {
    alert( storeid);
}